<template>
  <div class="topInner">
    <div class="container">
      <div class="bg">
        <img :src="coverImg" alt="背景图片" />
      </div>
      <div :class="!darkSkin ? 'mask' : 'mask dark'" ref="mask"></div>
      <div class="inner">
        <!-- <div class="blog_class">
          <ul>
            <li>
              <a href="#">#Plugins</a>
            </li>
            <li>
              <a href="#">#Vue</a>
            </li>
            <li>
              <a href="#">#JavaScipt</a>
            </li>
          </ul>
        </div>
        <div class="blog_title">Skygray's Blog</div>
        <div class="blog_autograph">个性签名</div>
        <div class="blog_detail">
          <div>2022-1-27 17:03</div>
          <div style="margin-left: 8px">
            <i class="iconfont icon-guankan"></i>
            <span style="margin-left: 5px">2000</span>
          </div>
          <div>
            <i class="iconfont icon-pinglun"></i>
            <span style="margin-left: 5px">200</span>
          </div>
        </div> -->
        <slot></slot>
      </div>
    </div>
    <div class="tip">
      <i class="iconfont icon-xiangxia"></i>
    </div>
  </div>
</template>

<script>
export default {
  name: "TopInner",
  props: {
    coverImg: String,
  },
  data() {
    return {};
  },
  computed: {
    darkSkin() {
      return this.$store.state.darkSkin;
    },
  },
};
</script>

<style scoped>
@keyframes blogTitleMove {
  0% {
    width: 0%;
  }
  100% {
    width: 30%;
  }
}
@keyframes tipDown {
  0% {
    transform: translate(-50%, 0%);
    opacity: 100;
  }
  100% {
    transform: translate(-50%, 150%);
    opacity: 0;
  }
}
* {
  list-style: none;
}
.topInner {
  position: relative;
  width: 100%;
  height: 110vh;
}
.container {
  position: relative;
  width: 100%;
  height: 100%;
}
.bg {
  width: 100%;
  height: 110vh;
}
.bg img {
  width: 100%;
  height: 110vh;
  object-fit: cover;
}
.mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 9;
}
.mask.dark {
  background-color: rgba(0, 0, 0, 0.5);
}
.inner {
  display: flex;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 50%;
  color: #ffffff;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  z-index: 99;
}
.blog_class {
  display: flex;
  width: 80%;
  height: 10%;
  justify-content: center;
  align-items: center;
}
.blog_class ul {
  display: flex;
  width: 80%;
  justify-content: space-around;
  align-items: center;
}
.blog_class li {
  display: flex;
  margin-left: 10px;
  width: 100%;
  justify-content: space-around;
}
.blog_class li:nth-child(1) {
  margin-left: 0;
}
.blog_class a {
  display: inline-block;
  font-size: 1.4rem;
  color: #4bcffa;
}
.blog_class a:hover {
  color: #ffffff;
}
.blog_title {
  display: flex;
  position: relative;
  width: 100%;
  height: 30%;
  font-size: 3rem;
  font-weight: 600;
  justify-content: center;
  align-items: center;
}
.blog_title::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translate(-50%, 0%);
  width: 30%;
  height: 4%;
  background-color: #55a6f7;
  animation: blogTitleMove 2s infinite;
}
.blog_autograph {
  display: flex;
  width: 100%;
  height: 30%;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
}
.blog_detail {
  display: flex;
  width: 60%;
  height: 10%;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}
.blog_detail div,
i,
span {
  font-size: 1.4rem;
}
.tip {
  position: absolute;
  bottom: 13%;
  left: 50%;
  transform: translate(-50%, 0);
  width: 50px;
  height: 30px;
  color: #ffffff;
  text-align: center;
  animation: tipDown 1.6s linear infinite;
  z-index: 999;
}
.tip:hover {
  cursor: pointer;
}
.tip i {
  font-size: 1.8rem;
}

@media only screen and (max-width: 768px) {
  .blog_class {
    justify-content: left;
  }
  .blog_title {
    justify-content: left;
  }
  .blog_autograph {
    justify-content: left;
  }
  .blog_title::after {
    left: 0;
    transform: translate(0%, 0%);
  }
  .blog_detail {
    width: 100%;
  }
}
</style>